package com.by.zhdoctor.repository;

import com.by.zhdoctor.domain.RuleRepository;
import com.by.zhdoctor.domain.Doctor;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.*;

import java.util.List;

/**
 * Spring Data JPA repository for the RuleRepository entity.
 */
@SuppressWarnings("unused")
public interface RuleRepositoryRepository extends JpaRepository<RuleRepository,Long> {

    @Query(value = "select doctor  from Doctor doctor join RuleRepository rule on doctor.login=rule.doctorName where rule.bingmingName=?1 group by doctor.doctorname")
    List<RuleRepository> findDocterNameListByBMName(String bmName);
    List<RuleRepository> findByBingmingNameAndDoctorName(String bmName,String dtName);
    Page<RuleRepository> findByDoctorName(String bmName, Pageable pageable);

}
